1. Field of the Invention
Methods and systems consistent with the present invention relate to an early Z test in a tile-based three-dimensional rendering, and more particularly, to an early Z test which may perform a rendering with respect to a triangle excluding a unseen portion which is being overlapped by another triangle.
2. Description of Related Art
Currently, as performance of personal terminals develop, providing information using three-dimensional (3D) graphics increases. Although 3D graphics were only used in computer terminals in the past, 3D graphics are currently used in a portable terminal such as a cell phone, a personal digital assistant (PDA), or a navigation system. A 3D model may be more realistically depicted in a display device which is two-dimensionally displayed, when using 3D graphics.
However, even when depicting the 3D model in 3D graphics, a user sees the 3D model via a 2D scene. Accordingly, a process of converting the 3D model which is viewed in the user's point of view is required so as to display the 3D model in the 2D scene to the user. In the process of the converting, rasterization, a process of generating the 2D scene, is performed. In the rasterization, the 3D model is converted from a vector format into a 2D coordinate, and rendered as a pixel-based 2D model. Also, an operation of generating the 2D scene is performed based on a triangle which is a basic unit of the 3D model.
According to a conventional art, each of the triangles to be processed in the rasterization is processed with respect to the entire scene. In this instance, a frame buffer, i.e., color buffer+Z-buffer, which has the same size as a screen resolution, is required. Also, the frame buffer may not be simply embedded in a chip due to its size. Accordingly, the frame buffer is randomly accessed via an external memory. Performing external memory access consumes about ten times as much power as performing memory access from memory embedded in a chip, and therefore the external memory access is required to be less frequently used in a mobile environment for low power consumption. Thus, a tile-based 3D rendering method is developed to overcome disadvantages described above.
The tile-based 3D rendering method segments a scene into a plurality of tiles, and performs a rendering with respect to only a triangle in a tile included in the triangle. In this instance, a rendering with respect to a single tile is performed by using a frame memory. The frame memory is embedded in a chip and has a resolution size of the single tile. After completing the rendering with respect to the tile, the rendered tile is transferred to an external frame buffer by using a burst mode. According to the tile-based 3D rendering method, frequent external frame buffer memory access may be eliminated, and an effective external burst memory access for each tile is performed only once. Accordingly, the tile-based 3D rendering method is effective in terms of low power consumption.
Also, after rasterization is completed, when a plurality of models are overlapped on the same position of a two-dimensionally converted coordinate, a model which is the closest to a user covers all remaining models located in the same position. Accordingly, only the model which is the closest to the user is required to be displayed on a screen. A Z test enables unseen models covered with other models to not be displayed on the screen.
FIG. 1 is a diagram illustrating a method of performing a Z test in a 3D rendering according to a conventional art.
As illustrated in FIG. 1, a scene which a user 110 looks at comprises four models 131, 132, 133, and 134. The user 110 may completely see the model 131, since the model 131 is a closest to the user. The user 110 may see only a lower portion of the model 132, since an upper portion of the model 132 is covered with the model 131. The model 133 is not seen, since the model 133 is completely covered with the models 131 and the 132. The user 110 may see only an upper portion of the model 134. As described above, a 3D depth of each of the models designates a Z value in order to ascertain a portion where the user 110 may actually see. When three-dimensionally displayed, the Z value indicates a value of a z-axis direction. The z-axis is at a right angle to an x-axis and a y-axis. As illustrated in a Z-axis 120 of FIG. 1, the further from the user 110 the models are on the z-axis 120, the greater the Z value is. Accordingly, the Z value gradually becomes greater from the model 131 to the model 134.
As described above, the Z test is required to be performed with the Z value of each pixel, after converting a 3D vector model into a pixel-based 2D model, i.e., completing a rasterization, since a general Z test is based on a 2D scene. When the Z test is performed after completing the rasterization, the rasterization with respect to unseen models covered with another model is also performed. Accordingly, unnecessary operation is performed.
Accordingly, in a tile-based 3D rendering, when performing a rendering for a triangle is eliminated since a corresponding tile is determined to not be displayed on a screen, the rendering for the entire scene may be more efficiently performed. Thus, an early Z test, which may eliminate the rendering with respect to the triangle in the tile which is determined to not be displayed on the screen, is desired.